package cn.com.seederland.gkrpc.server;

import cn.com.seederland.gkrpc.codec.Decoder;
import cn.com.seederland.gkrpc.codec.Encoder;
import cn.com.seederland.gkrpc.codec.JSONDecoder;
import cn.com.seederland.gkrpc.codec.JSONEncoder;
import cn.com.seederland.gkrpc.common.constants.HttpProtocolConstants;
import cn.com.seeederland.gkrpc.transport.HTTPTransportServer;
import cn.com.seeederland.gkrpc.transport.TransportServer;

/**
 * @ClassName ServerConfig
 * @Author SighFate
 * @Date 2020/10/06 23:33
 * @Version 1.0
 * @Description 服务端配置
 */
public class ServerConfig {

    private Class<? extends TransportServer> transPortClass = HTTPTransportServer.class;
    private Class<? extends Encoder> encoderClass = JSONEncoder.class;
    private Class<? extends Decoder> decoderClass = JSONDecoder.class;
    private int port = HttpProtocolConstants.PORT;

    public Class<? extends TransportServer> getTransPortClass() {
        return transPortClass;
    }

    public void setTransPortClass(Class<? extends TransportServer> transPortClass) {
        this.transPortClass = transPortClass;
    }

    public Class<? extends Encoder> getEncoderClass() {
        return encoderClass;
    }

    public void setEncoderClass(Class<? extends Encoder> encoderClass) {
        this.encoderClass = encoderClass;
    }

    public Class<? extends Decoder> getDecoderClass() {
        return decoderClass;
    }

    public void setDecoderClass(Class<? extends Decoder> decoderClass) {
        this.decoderClass = decoderClass;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }
}
